package com.ssy.lingxi.member.merchant.controller.mobile;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.member.merchant.model.vo.basic.request.MemberLogoVO;
import com.ssy.lingxi.member.merchant.model.vo.basic.response.MobileRegisterTagVO;
import com.ssy.lingxi.member.merchant.model.vo.basic.response.UserDetailVO;
import com.ssy.lingxi.member.merchant.model.vo.manage.request.MemberAndRoleIdVO;
import com.ssy.lingxi.member.merchant.service.mobile.IMobileCommonBusinessService;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @menu App - 会员其他业务相关接口
 * @author 万宁
 * @version 2.0.0
 * @date 2021-02-03
 */
@RestController
@RequestMapping("/member/mobile/business")
public class MobileCommonBusinessController {

    @Resource
    private IMobileCommonBusinessService mobileCommonBusinessService;

    /**
     * 新增或修改用户Logo
     * @param headers Http头部信息
     * @param logoVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/logo/add", method = RequestMethod.POST)
    public Wrapper<Void> addMemberUserLogo(@RequestHeader HttpHeaders headers, @RequestBody @Valid MemberLogoVO logoVO) {
        return mobileCommonBusinessService.addMemberUserLogo(headers, logoVO);
    }

    /**
     * 查询会员标签注册资料（电子签章 - 企业认证）
     * @param headers Http头部信息
     * @param idVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/detail/tag", method = RequestMethod.GET)
    public Wrapper<MobileRegisterTagVO> getMemberRegisterTagDetail(@RequestHeader HttpHeaders headers, @Valid MemberAndRoleIdVO idVO) {
        return mobileCommonBusinessService.getMemberRegisterTagDetail(headers, idVO);
    }

    /**
     * “电子签章 - 个人认证” - 查询用户注册资料
     * @param headers Http头部信息
     * @return 查询结果
     */
    @RequestMapping(value = "/user/detail/get", method = RequestMethod.GET)
    public Wrapper<UserDetailVO> getUserDetail(@RequestHeader HttpHeaders headers) {
        return mobileCommonBusinessService.getUserDetail(headers);
    }
}
